1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /**
18  * @addtogroup Configuration
19  * @{
20  */
21 
22 /**
23  * @file configuration.h
24  */
25 
26 module android.ndk.configuration;
27 
28 import arsd.jni;
29 import android.ndk;
30 
31 extern (C):
32 nothrow:
33 @nogc:
34 
35 /* nothing */
36 
37 struct AConfiguration;
38 /**
39  * {@link AConfiguration} is an opaque type used to get and set
40  * various subsystem configurations.
41  *
42  * A {@link AConfiguration} pointer can be obtained using:
43  * - AConfiguration_new()
44  * - AConfiguration_fromAssetManager()
45  */
46 
47 /**
48  * Define flags and constants for various subsystem configurations.
49  */
50 enum
51 {
52     /** Orientation: not specified. */
53     ACONFIGURATION_ORIENTATION_ANY = 0x0000,
54     /**
55      * Orientation: value corresponding to the
56      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
57      * resource qualifier.
58      */
59     ACONFIGURATION_ORIENTATION_PORT = 0x0001,
60     /**
61      * Orientation: value corresponding to the
62      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
63      * resource qualifier.
64      */
65     ACONFIGURATION_ORIENTATION_LAND = 0x0002,
66     /** @deprecated Not currently supported or used. */
67     ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
68 
69     /** Touchscreen: not specified. */
70     ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000,
71     /**
72      * Touchscreen: value corresponding to the
73      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a>
74      * resource qualifier.
75      */
76     ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001,
77     /** @deprecated Not currently supported or used. */
78     ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002,
79     /**
80      * Touchscreen: value corresponding to the
81      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a>
82      * resource qualifier.
83      */
84     ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003,
85 
86     /** Density: default density. */
87     ACONFIGURATION_DENSITY_DEFAULT = 0,
88     /**
89      * Density: value corresponding to the
90      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a>
91      * resource qualifier.
92      */
93     ACONFIGURATION_DENSITY_LOW = 120,
94     /**
95      * Density: value corresponding to the
96      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a>
97      * resource qualifier.
98      */
99     ACONFIGURATION_DENSITY_MEDIUM = 160,
100     /**
101      * Density: value corresponding to the
102      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a>
103      * resource qualifier.
104      */
105     ACONFIGURATION_DENSITY_TV = 213,
106     /**
107      * Density: value corresponding to the
108      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a>
109      * resource qualifier.
110      */
111     ACONFIGURATION_DENSITY_HIGH = 240,
112     /**
113      * Density: value corresponding to the
114      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a>
115      * resource qualifier.
116      */
117     ACONFIGURATION_DENSITY_XHIGH = 320,
118     /**
119      * Density: value corresponding to the
120      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a>
121      * resource qualifier.
122      */
123     ACONFIGURATION_DENSITY_XXHIGH = 480,
124     /**
125      * Density: value corresponding to the
126      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a>
127      * resource qualifier.
128      */
129     ACONFIGURATION_DENSITY_XXXHIGH = 640,
130     /** Density: any density. */
131     ACONFIGURATION_DENSITY_ANY = 0xfffe,
132     /** Density: no density specified. */
133     ACONFIGURATION_DENSITY_NONE = 0xffff,
134 
135     /** Keyboard: not specified. */
136     ACONFIGURATION_KEYBOARD_ANY = 0x0000,
137     /**
138      * Keyboard: value corresponding to the
139      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a>
140      * resource qualifier.
141      */
142     ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001,
143     /**
144      * Keyboard: value corresponding to the
145      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a>
146      * resource qualifier.
147      */
148     ACONFIGURATION_KEYBOARD_QWERTY = 0x0002,
149     /**
150      * Keyboard: value corresponding to the
151      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a>
152      * resource qualifier.
153      */
154     ACONFIGURATION_KEYBOARD_12KEY = 0x0003,
155 
156     /** Navigation: not specified. */
157     ACONFIGURATION_NAVIGATION_ANY = 0x0000,
158     /**
159      * Navigation: value corresponding to the
160      * <a href="@@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a>
161      * resource qualifier.
162      */
163     ACONFIGURATION_NAVIGATION_NONAV = 0x0001,
164     /**
165      * Navigation: value corresponding to the
166      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a>
167      * resource qualifier.
168      */
169     ACONFIGURATION_NAVIGATION_DPAD = 0x0002,
170     /**
171      * Navigation: value corresponding to the
172      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a>
173      * resource qualifier.
174      */
175     ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003,
176     /**
177      * Navigation: value corresponding to the
178      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a>
179      * resource qualifier.
180      */
181     ACONFIGURATION_NAVIGATION_WHEEL = 0x0004,
182 
183     /** Keyboard availability: not specified. */
184     ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
185     /**
186      * Keyboard availability: value corresponding to the
187      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keysexposed</a>
188      * resource qualifier.
189      */
190     ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
191     /**
192      * Keyboard availability: value corresponding to the
193      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyshidden</a>
194      * resource qualifier.
195      */
196     ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
197     /**
198      * Keyboard availability: value corresponding to the
199      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyssoft</a>
200      * resource qualifier.
201      */
202     ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
203 
204     /** Navigation availability: not specified. */
205     ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
206     /**
207      * Navigation availability: value corresponding to the
208      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navexposed</a>
209      * resource qualifier.
210      */
211     ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
212     /**
213      * Navigation availability: value corresponding to the
214      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navhidden</a>
215      * resource qualifier.
216      */
217     ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
218 
219     /** Screen size: not specified. */
220     ACONFIGURATION_SCREENSIZE_ANY = 0x00,
221     /**
222      * Screen size: value indicating the screen is at least
223      * approximately 320x426 dp units, corresponding to the
224      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">small</a>
225      * resource qualifier.
226      */
227     ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
228     /**
229      * Screen size: value indicating the screen is at least
230      * approximately 320x470 dp units, corresponding to the
231      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">normal</a>
232      * resource qualifier.
233      */
234     ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
235     /**
236      * Screen size: value indicating the screen is at least
237      * approximately 480x640 dp units, corresponding to the
238      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">large</a>
239      * resource qualifier.
240      */
241     ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
242     /**
243      * Screen size: value indicating the screen is at least
244      * approximately 720x960 dp units, corresponding to the
245      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">xlarge</a>
246      * resource qualifier.
247      */
248     ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
249 
250     /** Screen layout: not specified. */
251     ACONFIGURATION_SCREENLONG_ANY = 0x00,
252     /**
253      * Screen layout: value that corresponds to the
254      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">notlong</a>
255      * resource qualifier.
256      */
257     ACONFIGURATION_SCREENLONG_NO = 0x1,
258     /**
259      * Screen layout: value that corresponds to the
260      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">long</a>
261      * resource qualifier.
262      */
263     ACONFIGURATION_SCREENLONG_YES = 0x2,
264 
265     ACONFIGURATION_SCREENROUND_ANY = 0x00,
266     ACONFIGURATION_SCREENROUND_NO = 0x1,
267     ACONFIGURATION_SCREENROUND_YES = 0x2,
268 
269     /** Wide color gamut: not specified. */
270     ACONFIGURATION_WIDE_COLOR_GAMUT_ANY = 0x00,
271     /**
272      * Wide color gamut: value that corresponds to
273      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">no
274      * nowidecg</a> resource qualifier specified.
275      */
276     ACONFIGURATION_WIDE_COLOR_GAMUT_NO = 0x1,
277     /**
278      * Wide color gamut: value that corresponds to
279      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">
280      * widecg</a> resource qualifier specified.
281      */
282     ACONFIGURATION_WIDE_COLOR_GAMUT_YES = 0x2,
283 
284     /** HDR: not specified. */
285     ACONFIGURATION_HDR_ANY = 0x00,
286     /**
287      * HDR: value that corresponds to
288      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">
289      * lowdr</a> resource qualifier specified.
290      */
291     ACONFIGURATION_HDR_NO = 0x1,
292     /**
293      * HDR: value that corresponds to
294      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">
295      * highdr</a> resource qualifier specified.
296      */
297     ACONFIGURATION_HDR_YES = 0x2,
298 
299     /** UI mode: not specified. */
300     ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
301     /**
302      * UI mode: value that corresponds to
303      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">no
304      * UI mode type</a> resource qualifier specified.
305      */
306     ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
307     /**
308      * UI mode: value that corresponds to
309      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
310      */
311     ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
312     /**
313      * UI mode: value that corresponds to
314      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
315      */
316     ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
317     /**
318      * UI mode: value that corresponds to
319      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
320      */
321     ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
322     /**
323      * UI mode: value that corresponds to
324      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
325      */
326     ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
327     /**
328      * UI mode: value that corresponds to
329      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
330      */
331     ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
332     /**
333      * UI mode: value that corresponds to
334      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">vr</a> resource qualifier specified.
335      */
336     ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET = 0x07,
337 
338     /** UI night mode: not specified.*/
339     ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
340     /**
341      * UI night mode: value that corresponds to
342      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
343      */
344     ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
345     /**
346      * UI night mode: value that corresponds to
347      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
348      */
349     ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
350 
351     /** Screen width DPI: not specified. */
352     ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
353 
354     /** Screen height DPI: not specified. */
355     ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
356 
357     /** Smallest screen width DPI: not specified.*/
358     ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
359 
360     /** Layout direction: not specified. */
361     ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
362     /**
363      * Layout direction: value that corresponds to
364      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
365      */
366     ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
367     /**
368      * Layout direction: value that corresponds to
369      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
370      */
371     ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
372 
373     /**
374      * Bit mask for
375      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
376      * configuration.
377      */
378     ACONFIGURATION_MCC = 0x0001,
379     /**
380      * Bit mask for
381      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
382      * configuration.
383      */
384     ACONFIGURATION_MNC = 0x0002,
385     /**
386      * Bit mask for
387      * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
388      * configuration.
389      */
390     ACONFIGURATION_LOCALE = 0x0004,
391     /**
392      * Bit mask for
393      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
394      * configuration.
395      */
396     ACONFIGURATION_TOUCHSCREEN = 0x0008,
397     /**
398      * Bit mask for
399      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
400      * configuration.
401      */
402     ACONFIGURATION_KEYBOARD = 0x0010,
403     /**
404      * Bit mask for
405      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
406      * configuration.
407      */
408     ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
409     /**
410      * Bit mask for
411      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
412      * configuration.
413      */
414     ACONFIGURATION_NAVIGATION = 0x0040,
415     /**
416      * Bit mask for
417      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
418      * configuration.
419      */
420     ACONFIGURATION_ORIENTATION = 0x0080,
421     /**
422      * Bit mask for
423      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
424      * configuration.
425      */
426     ACONFIGURATION_DENSITY = 0x0100,
427     /**
428      * Bit mask for
429      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
430      * configuration.
431      */
432     ACONFIGURATION_SCREEN_SIZE = 0x0200,
433     /**
434      * Bit mask for
435      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
436      * configuration.
437      */
438     ACONFIGURATION_VERSION = 0x0400,
439     /**
440      * Bit mask for screen layout configuration.
441      */
442     ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
443     /**
444      * Bit mask for
445      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
446      * configuration.
447      */
448     ACONFIGURATION_UI_MODE = 0x1000,
449     /**
450      * Bit mask for
451      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
452      * configuration.
453      */
454     ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
455     /**
456      * Bit mask for
457      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
458      * configuration.
459      */
460     ACONFIGURATION_LAYOUTDIR = 0x4000,
461     ACONFIGURATION_SCREEN_ROUND = 0x8000,
462     /**
463      * Bit mask for
464      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">wide color gamut</a>
465      * and <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">HDR</a> configurations.
466      */
467     ACONFIGURATION_COLOR_MODE = 0x10000,
468     /**
469      * Constant used to to represent MNC (Mobile Network Code) zero.
470      * 0 cannot be used, since it is used to represent an undefined MNC.
471      */
472     ACONFIGURATION_MNC_ZERO = 0xffff
473 }
474 
475 /**
476  * Create a new AConfiguration, initialized with no values set.
477  */
478 AConfiguration* AConfiguration_new ();
479 
480 /**
481  * Free an AConfiguration that was previously created with
482  * AConfiguration_new().
483  */
484 void AConfiguration_delete (AConfiguration* config);
485 
486 /**
487  * Create and return a new AConfiguration based on the current configuration in
488  * use in the given {@link AAssetManager}.
489  */
490 void AConfiguration_fromAssetManager (AConfiguration* out_, AAssetManager* am);
491 
492 /**
493  * Copy the contents of 'src' to 'dest'.
494  */
495 void AConfiguration_copy (AConfiguration* dest, AConfiguration* src);
496 
497 /**
498  * Return the current MCC set in the configuration.  0 if not set.
499  */
500 int AConfiguration_getMcc (AConfiguration* config);
501 
502 /**
503  * Set the current MCC in the configuration.  0 to clear.
504  */
505 void AConfiguration_setMcc (AConfiguration* config, int mcc);
506 
507 /**
508  * Return the current MNC set in the configuration.  0 if not set.
509  */
510 int AConfiguration_getMnc (AConfiguration* config);
511 
512 /**
513  * Set the current MNC in the configuration.  0 to clear.
514  */
515 void AConfiguration_setMnc (AConfiguration* config, int mnc);
516 
517 /**
518  * Return the current language code set in the configuration.  The output will
519  * be filled with an array of two characters.  They are not 0-terminated.  If
520  * a language is not set, they will be 0.
521  */
522 void AConfiguration_getLanguage (AConfiguration* config, char* outLanguage);
523 
524 /**
525  * Set the current language code in the configuration, from the first two
526  * characters in the string.
527  */
528 void AConfiguration_setLanguage (AConfiguration* config, const(char)* language);
529 
530 /**
531  * Return the current country code set in the configuration.  The output will
532  * be filled with an array of two characters.  They are not 0-terminated.  If
533  * a country is not set, they will be 0.
534  */
535 void AConfiguration_getCountry (AConfiguration* config, char* outCountry);
536 
537 /**
538  * Set the current country code in the configuration, from the first two
539  * characters in the string.
540  */
541 void AConfiguration_setCountry (AConfiguration* config, const(char)* country);
542 
543 /**
544  * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
545  */
546 int AConfiguration_getOrientation (AConfiguration* config);
547 
548 /**
549  * Set the current orientation in the configuration.
550  */
551 void AConfiguration_setOrientation (AConfiguration* config, int orientation);
552 
553 /**
554  * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
555  */
556 int AConfiguration_getTouchscreen (AConfiguration* config);
557 
558 /**
559  * Set the current touchscreen in the configuration.
560  */
561 void AConfiguration_setTouchscreen (AConfiguration* config, int touchscreen);
562 
563 /**
564  * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
565  */
566 int AConfiguration_getDensity (AConfiguration* config);
567 
568 /**
569  * Set the current density in the configuration.
570  */
571 void AConfiguration_setDensity (AConfiguration* config, int density);
572 
573 /**
574  * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
575  */
576 int AConfiguration_getKeyboard (AConfiguration* config);
577 
578 /**
579  * Set the current keyboard in the configuration.
580  */
581 void AConfiguration_setKeyboard (AConfiguration* config, int keyboard);
582 
583 /**
584  * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
585  */
586 int AConfiguration_getNavigation (AConfiguration* config);
587 
588 /**
589  * Set the current navigation in the configuration.
590  */
591 void AConfiguration_setNavigation (AConfiguration* config, int navigation);
592 
593 /**
594  * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
595  */
596 int AConfiguration_getKeysHidden (AConfiguration* config);
597 
598 /**
599  * Set the current keys hidden in the configuration.
600  */
601 void AConfiguration_setKeysHidden (AConfiguration* config, int keysHidden);
602 
603 /**
604  * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
605  */
606 int AConfiguration_getNavHidden (AConfiguration* config);
607 
608 /**
609  * Set the current nav hidden in the configuration.
610  */
611 void AConfiguration_setNavHidden (AConfiguration* config, int navHidden);
612 
613 /**
614  * Return the current SDK (API) version set in the configuration.
615  */
616 int AConfiguration_getSdkVersion (AConfiguration* config);
617 
618 /**
619  * Set the current SDK version in the configuration.
620  */
621 void AConfiguration_setSdkVersion (AConfiguration* config, int sdkVersion);
622 
623 /**
624  * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
625  */
626 int AConfiguration_getScreenSize (AConfiguration* config);
627 
628 /**
629  * Set the current screen size in the configuration.
630  */
631 void AConfiguration_setScreenSize (AConfiguration* config, int screenSize);
632 
633 /**
634  * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
635  */
636 int AConfiguration_getScreenLong (AConfiguration* config);
637 
638 /**
639  * Set the current screen long in the configuration.
640  */
641 void AConfiguration_setScreenLong (AConfiguration* config, int screenLong);
642 
643 /**
644  * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
645  */
646 int AConfiguration_getScreenRound (AConfiguration* config);
647 
648 /**
649  * Set the current screen round in the configuration.
650  */
651 void AConfiguration_setScreenRound (AConfiguration* config, int screenRound);
652 
653 /**
654  * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
655  */
656 int AConfiguration_getUiModeType (AConfiguration* config);
657 
658 /**
659  * Set the current UI mode type in the configuration.
660  */
661 void AConfiguration_setUiModeType (AConfiguration* config, int uiModeType);
662 
663 /**
664  * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
665  */
666 int AConfiguration_getUiModeNight (AConfiguration* config);
667 
668 /**
669  * Set the current UI mode night in the configuration.
670  */
671 void AConfiguration_setUiModeNight (AConfiguration* config, int uiModeNight);
672 
673 /**
674  * Return the current configuration screen width in dp units, or
675  * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
676  */
677 int AConfiguration_getScreenWidthDp (AConfiguration* config);
678 
679 /**
680  * Set the configuration's current screen width in dp units.
681  */
682 void AConfiguration_setScreenWidthDp (AConfiguration* config, int value);
683 
684 /**
685  * Return the current configuration screen height in dp units, or
686  * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
687  */
688 int AConfiguration_getScreenHeightDp (AConfiguration* config);
689 
690 /**
691  * Set the configuration's current screen width in dp units.
692  */
693 void AConfiguration_setScreenHeightDp (AConfiguration* config, int value);
694 
695 /**
696  * Return the configuration's smallest screen width in dp units, or
697  * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
698  */
699 int AConfiguration_getSmallestScreenWidthDp (AConfiguration* config);
700 
701 /**
702  * Set the configuration's smallest screen width in dp units.
703  */
704 void AConfiguration_setSmallestScreenWidthDp (AConfiguration* config, int value);
705 /* __ANDROID_API__ >= 13 */
706 
707 /**
708  * Return the configuration's layout direction, or
709  * ACONFIGURATION_LAYOUTDIR_ANY if not set.
710  */
711 int AConfiguration_getLayoutDirection (AConfiguration* config);
712 
713 /**
714  * Set the configuration's layout direction.
715  */
716 void AConfiguration_setLayoutDirection (AConfiguration* config, int value);
717 /* __ANDROID_API__ >= 17 */
718 
719 /**
720  * Perform a diff between two configurations.  Returns a bit mask of
721  * ACONFIGURATION_* constants, each bit set meaning that configuration element
722  * is different between them.
723  */
724 int AConfiguration_diff (AConfiguration* config1, AConfiguration* config2);
725 
726 /**
727  * Determine whether 'base' is a valid configuration for use within the
728  * environment 'requested'.  Returns 0 if there are any values in 'base'
729  * that conflict with 'requested'.  Returns 1 if it does not conflict.
730  */
731 int AConfiguration_match (AConfiguration* base, AConfiguration* requested);
732 
733 /**
734  * Determine whether the configuration in 'test' is better than the existing
735  * configuration in 'base'.  If 'requested' is non-NULL, this decision is based
736  * on the overall configuration given there.  If it is NULL, this decision is
737  * simply based on which configuration is more specific.  Returns non-0 if
738  * 'test' is better than 'base'.
739  *
740  * This assumes you have already filtered the configurations with
741  * AConfiguration_match().
742  */
743 int AConfiguration_isBetterThan (
744     AConfiguration* base,
745     AConfiguration* test,
746     AConfiguration* requested);
747 
748 // ANDROID_CONFIGURATION_H
749 
750 /** @} */